from django import forms
from .models import Contact

class ContactForm(forms.ModelForm):
    class Meta:
        model = Contact
        fields = ['name', 'email', 'phone', 'company', 'position', 'message']
        widgets = {
            'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '您的姓名'}),
            'email': forms.EmailInput(attrs={'class': 'form-control', 'placeholder': '您的电子邮箱'}),
            'phone': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '您的电话'}),
            'company': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '您的公司'}),
            'position': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '您的职位'}),
            'message': forms.Textarea(attrs={'class': 'form-control', 'placeholder': '您的留言', 'rows': 5}),
        } 